USE [EstudiosComerciales]
GO

-- creating the store procedure
IF EXISTS (SELECT name 
	   FROM   sysobjects 
	   WHERE  name = 'WASP_D0003_TRANF_TABLE_CSOPF001' 
	   AND 	  type = 'P')
    DROP PROCEDURE [dbo].[WASP_D0003_TRANF_TABLE_CSOPF001]
GO

CREATE PROCEDURE [dbo].[WASP_D0003_TRANF_TABLE_CSOPF001]
AS

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CSOPF001]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CSOPF001]

CREATE TABLE [dbo].[CSOPF001] 
(
	[CCAGENCIA] [decimal](2, 0) NULL ,
	[CCCREDITO] [numeric](10, 0) NULL ,
	[CCCUOTA] [numeric](18, 0) NULL ,
	[CCCLASE] [smallint] NOT NULL ,
	[CCFECCOBRO] [decimal](8, 0) NULL ,
	[CCCAPITAL] [numeric](12, 0) NULL ,
	[CCINTERES] [decimal](18, 2) NULL ,
	[CCFECHPAGO] [numeric](8, 0) NULL ,
	[CCAGECOLOC] [smallint] NULL 
) ON [PRIMARY]

Insert into dbo.CSOPF001 select * from [Gestion2].[dbo].[AS_CSOPF001]